﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;

namespace OA.DAL
{
    public class EventsNotify : Base<Model.EventsNotify>
    {
        public EventsNotify(ISession isession)
            : base(isession)
        {
            
        }


        public Model.EventsNotify Get(string eventCode, string userName)
        {
            Model.EventsNotify ret = null;
            var list = Get("EventCode=? and UserName=?", null, 0, 0, eventCode, userName);
            if (list.Count > 0)
            {
                ret = list[0];
            }
            return ret;
        }

        public Common.Result Delete(string eventCode, string ids)
        {
            return DeleteByStringKey("UserName", ids, "EventCode='" + eventCode + "'");
        }
    }
}
